package com.vertx.starter;

import io.vertx.core.Verticle;
import org.apache.commons.lang3.StringUtils;

public class VertxUtils {

    public VertxUtils() {
    }

    public static String getGuiceClassName(Class<? extends Verticle> clazz) {
        String prefix = "guice";
        String className = clazz.getName();
        return String.format("%s:%s", prefix, className);
    }

    public static String generateAddress(Class<?> clazz, String... extraArr) {
        return extraArr.length == 0 ? clazz.getCanonicalName() : String.format("%s.%s", clazz.getCanonicalName(), StringUtils.join(extraArr));
    }

}
